<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>局部组件</title>
    <script src="../js/axios.min.js"></script>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
<login></login>

</div>
</body>

</html>
<template id="loginTemplate">
    <div><h3>用户登录的局部组件</h3><button>+</button>
    <input type="text"></div>
</template>

<script>
    const login = {
        template: "#loginTemplate",
    };

    const app = new Vue({
        el: "#app",   //element:元素
        data: {        //data:数据 用来vue实例对象绑定一系列数据
            msg: "局部组件",
        },
        methods: {},
        computed: {},
        components: {
            login,
        },
    });
</script>
